<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <style media="screen">
        .cube {
            transform-style: preserve-3d;
            width: 200px;
            height: 200px;
            position: relative;
            top: 200px;
            left: 200px;
            border: 1px solid blue;
            transform: rotateX(30deg) rotateY(20deg) ;
            transition: transform 5s;
            animation: move 2s ease 1s infinite alternate;
        }
        @keyframes move{
            from{
                transform: translateX(200px) translateY(200px) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }
            to{
                transform: translateX(400px) translateY(400px) rotateX(90deg) rotateY(90deg) rotateZ(90deg);
            }
        }
        .cube:hover{
            transform: rotateX(60deg) rotateY(50deg);
        }
        .part {
            position: absolute;
            width: 200px;
            height: 200px;
            /* opacity: .7; */
        }

        .part:nth-child(1) {
            background: yellow;
            transform: translateX(100px) rotateY(90deg);
        }

        .part:nth-child(2) {
            transform: translateX(-100px) rotateY(90deg);
            background: green;
        }

        .part:nth-child(3) {
            transform: translateY(100px) rotateX(90deg);
            background: pink;
        }

        .part:nth-child(4) {
            transform: translateY(-100px) rotateX(90deg);
            background: purple;
        }

        .part:nth-child(5) {
            transform: translateZ(-100px);
            background: orange;
        }
    </style>
</head>

<body>

    <div class="cube">
        <div class="part"></div>
        <div class="part"></div>
        <div class="part"></div>
        <div class="part"></div>
        <div class="part"></div>
    </div>


</body>

</html>